<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
      <!-- import CSS -->
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
</head>
<body>
    <div id="app" style="margin-top: 40px;margin-left: 45px;">
        <el-row style="float: left;">
    
<!--            <el-button type="primary" @click="getBack">返回</el-button>-->
            <el-page-header @back="goBack" content="详情页面"></el-page-header>
        </el-row>


        <div style="width: 1266px;height: 100%;padding-top: 65px;">
            <h1>{{article.advertisingTitle}}</h1>
            <span>{{article.startTime}}</span>
            <div class="demo-image__placeholder">
                <div class="block">
                    <el-image :src="src"></el-image>
                </div>
            </div>
        </div>

    </div>
</body>
  <!-- import Vue before Element -->
  <script src="https://unpkg.com/vue@2/dist/vue.js"></script>
  <!-- import JavaScript -->
  <script src="https://unpkg.com/element-ui/lib/index.js"></script>
    <script src="../../data/axios-0.18.0.js"></script>
  <script>
      new Vue({
          el: '#app',
            data() {
              return {
                  article:{
                      advertisingTitle:'',
                      startTime:'',
                  },
                  src: ''
              }
          },
          created() {
              this.init()
          },
          methods: {
              handleChange(val) {
                console.log(val);
              },
              goBack() {
                  location.href="../advertising.html";
              },
              init(){
                  var id  = window.localStorage.getItem('advertisingId')
                  console.log(id)
                  window.localStorage.removeItem('advertisingId')
                  axios({
                      method: "get",
                      url: "/advertising/"+id
                  }).then(res=>{
                      console.log(res.data.data)
                      this.article = res.data.data
                      this.src= res.data.data.img
                  })
              }
          }
      })
  </script>
</html>